<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class ModifyCustomerContact extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasColumn('customer', 'contact_at')) {
            Schema::table('customer', function (Blueprint $table) {
                $table->string('contact_at')->after('address')->comment('合作开始时间');
            });
        }

        if (!Schema::hasColumn('customer', 'service_limit')) {
            Schema::table('customer', function (Blueprint $table) {
                $table->unsignedInteger('service_limit')->after('status')->comment('服务年限');
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
